\chapter{Filters}

\section{Introduction}

\subsection{Key Concepts}

ngscopeclient and libscopehal are based on a ``filter graph" architecture internally. The filter graph is a directed
acyclic graph with a set of source nodes (waveforms captured from hardware, loaded from a saved session, or generated
numerically) and sink nodes (waveform views, protocol analyzer views, and statistics) connected by edges representing
data flow.

A filter is simply an intermediate node in the graph, which takes input from zero or more waveform nodes and outputs a
waveform which may be displayed, used as input to other filters, or both. A waveform is a series of data points which
may represent voltages, digital samples, or arbitrarily complex protocol data structures.

As a result, there is no internal distinction between math functions, measurements, and protocol decodes, and it is
possible to chain them arbitrarily. Consider the following example:

\begin{itemize}
\item Two analog waveforms representing serial data and clock are acquired
\item Each analog waveform is thresholded, producing a digital waveform
\item The two digital waveforms are decoded as $I^2C$, producing a series of packets
\item The $I^2C$ packets are decoded as writes to a serial DAC, producing an analog waveform
\item A moving average filter is applied to the analog waveform
\item A measurement filter finds the instantaneous frequency of each cycle of the DAC output
\end{itemize}

In this document we use the term ``filter" consistently to avoid ambiguity.

\subsection{Conventions}

A filter can take arbitrarily many inputs (vector or scalar values from the filter graph), arbitrarily many parameters
(static scalar configuration settings), and outputs arbitrarily many vector or scalar outputs.

If the output signal is a multi-field type (as opposed to a single scalar, e.g. voltage, at each sample) the
``Output Signal" section will include a table describing how various types of output data are displayed.

All filters with complex output use a standardized set of colors to display various types of data fields in a
consistent manner. These colors are configurable under the \menustyle{Appearance / Decodes} preferences category.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Color name} & \textbf{Use case} & \textbf{Default Color} \\
\thickhline
Address & Memory addresses & \cellcolor{address}\textcolor{black}{\#ffff00} \\
\thinhline
Checksum Bad & Incorrect CRC/checksum & \cellcolor{checksumbad}\textcolor{white}{\#ff0000} \\
\thinhline
Checksum OK & Valid CRC/checksum & \cellcolor{checksumok}\textcolor{black}{\#00ff00} \\
\thinhline
Control & Miscellaneous control data & \cellcolor{control}\textcolor{white}{\#c000a0} \\
\thinhline
Data & User data & \cellcolor{data}\textcolor{white}{\#336699} \\
\thinhline
Error & Malformed/unreadable data & \cellcolor{error}\textcolor{white}{\#ff0000} \\
\thinhline
Idle & Inter-frame gaps & \cellcolor{idle}\textcolor{white}{\#404040} \\
\thinhline
Preamble & Preamble/sync words & \cellcolor{preamble}\textcolor{white}{\#808080} \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{128b/130b}
\label{filter:128b130b}

Decodes the 128b/130b line code used by PCIe gen 3/4/5. This filter performs block alignment and descrambling, but no
decoding of block contents.

128b/130b, as a close relative of \hyperref[filter:128b130b]{64b/66b}, is a serial line code which divides transmitted
data into 128-bit blocks and scrambles them with a LFSR, then appends a 2-bit type field (which is not scrambled) to
each block for synchronization. Block synchronization depends on always having an edge in the type field so types 2'b00
and 2'b11 are disallowed.

For PCIe over 128b/130b, block type 2'b01 contains 128 bits of upper layer protocol data while block type 2'b10
contains an ordered set.

Note that this filter only performs block alignment and descrambling. No decoding or parsing is applied to the 128-bit
blocks, other than searching for skip ordered sets (beginning with 0xaa) and using them for scrambler synchronization.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/128b130b.png}
\caption{Example 128b/130b decode}
\label{filter_128b130b}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-pcie-gen3.png}
\caption{Example filter graph using 128b/130b to decode a 2-lane PCIe gen3 link}
\label{filter_graph_128b130b}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Digital & Serial 128b/130b data line \\
\thinhline
clk & Digital & DDR bit clock, typically generated by use of the \hyperref[filter:cdrpll]{Clock Recovery
(PLL)} filter on the input data.\\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

The 128B/130B filter outputs a time series of 128B/130B sample objects. These consist of a control/data flag and
a 128-bit data block.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Stream name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Sparse protocol & Output decode \\
\thickhline
\end{tabularx}

\begin{tabularx}{16cm}{lllX}
\thickhline
\textbf{Type} & \textbf{Description} & \textbf{Color} & \textbf{Format} \\
\thickhline
Ordered set & Block with type 2'b10 & \cellcolor{control}\textcolor{white}{Control} & \%032x \\
\thinhline
Data & Block with type 2'b01 & \cellcolor{data}\textcolor{white}{Data} & \%032x \\
\thinhline
Error & Block with type 2'b00 or 2'b11 & \cellcolor{error}\textcolor{white}{Error} & \%032x \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{2-Port Shunt Through}
\label{filter:2portshuntthrough}

Measures the impedance of a DUT connected to a VNA in a 2-port shunt-through topology (VNA ports 1 and 2 connected,
with DUT attached between the connection point and ground). This is commonly used for measuring very low impedance
networks, such as power distribution networks.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{64b/66b}
\label{filter:64b66b}

Decodes the 64/66b line code used by \hyperref[filter:10gbaser]{10Gbase-R} and other serial protocols, as originally
specified in IEEE 802.3 clause 49.2.

64b/66b is a serial line code which divides transmitted data into 64-bit blocks and scrambles them with a LFSR, then
appends a 2-bit type field (which is not scrambled) to each block for synchronization. Block synchronization depends on
always having an edge in the type field so types 2'b00 and 2'b11 are disallowed.

Note that this filter only performs block alignment and descrambling. No decoding is applied to the 64-bit blocks, as
different upper-layer protocols assign different meaning to them. In 10Gbase-R, type 2'b01 denotes ``64 bits of upper
layer data" and type 2'b10 denotes ``8-bit type field and 56 bits of data whose meaning depends on the type", however
this is not universal and some other protocols use these fields for different purposes.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/64b66b.png}
\caption{Example 64b/66b decode}
\label{filter_64b66b}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-10gbe.png}
\caption{Example filter graph using 64b/66b to decode a 10Gbase-R signal}
\label{filter_graph_64b66b}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Digital & Serial 64b/66b data line \\
\thinhline
clk & Digital & DDR bit clock, typically generated by use of the \hyperref[filter:cdrpll]{Clock Recovery
(PLL)} filter on the input data.\\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

The 64B/66B filter outputs a time series of 64B/66B sample objects. These consist of a control/data flag and
a 64-bit data block.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Stream name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Sparse protocol & Output decode \\
\thickhline
\end{tabularx}

\begin{tabularx}{16cm}{lllX}
\thickhline
\textbf{Type} & \textbf{Description} & \textbf{Color} & \textbf{Format} \\
\thickhline
Control & Block with type 2'b10 & \cellcolor{control}\textcolor{white}{Control} & \%016x \\
\thinhline
Data & Block with type 2'b01 & \cellcolor{data}\textcolor{white}{Data} & \%016x \\
\thinhline
Error & Block with type 2'b00 or 2'b11 & \cellcolor{error}\textcolor{white}{Error} & \%016x \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{8B/10B (IBM)}
\label{filter:8b10b}

Decodes the standard 8b/10b line code used by \hyperref[filter:sgmii]{SGMII}, \hyperref[filter:1000basex]{1000base-X},
DisplayPort, JESD204A/B, \hyperref[filter:pcie2_logical]{PCIe gen 1/2}, SATA, USB 3.0, and many other common serial
protocols.

8b/10b is a dictionary based code which converts each byte of message data to a ten-bit code. In order to maintain DC
balance and limit run length to a maximum of five identical bits in a row, all 8-bit input codes have one of:
\begin{itemize}
\item One legal coding, with exactly five zero bits
\item Two legal codings, one with four zero bits and one with six
\end{itemize}

The transmitter maintains a ``running disparity" counter and chooses the appropriate coding for each symbol to ensure
DC balance. There are twelve legal codes which are not needed for encoding data values; these are used to encode
frame boundaries, idle/alignment sequences, and other control information.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/8b10b.png}
\caption{Example 8b/10b decode}
\label{filter_8b10b}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-1000basex.png}
\caption{Example filter graph using 8b/10b to decode a differential 1000base-X link}
\label{filter_graph_8b10b}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Digital & Serial 8b/10b data line \\
\thinhline
clk & Digital & DDR bit clock, typically generated by use of the \hyperref[filter:cdrpll]{Clock Recovery
(PLL)} filter on the input data.\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thinhline
Comma Search Window & Integer &
Number of unit intervals to search when performing comma alignment. A larger window increases the probability of a
correct lock if commas are infrequent, but significantly slows down the decode. The default is 20000 UI. \\
\thinhline
Display Format & Enum &
	\textbf{Dotted (K28.5 D21.5)}: displays the 3b4b and 5b6b code blocks separately, with K or D prefix, as well as the current running disparity. \newline
	\textbf{Hex (K.bc b5)}: displays data as hex byte values and control codes with a K prefix. \\
\thickhline
\end{tabularx}

\subsection{Output Signal}

The 8B/10B filter outputs a time series of 8B/10B sample objects. These consist of a control/data flag, the current
running disparity, and a byte of data.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Stream name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Sparse protocol & Output decode \\
\thickhline
\end{tabularx}

\begin{tabularx}{16cm}{lllX}
\thickhline
\textbf{Type} & \textbf{Description} & \textbf{Color} & \textbf{Format} \\
\thickhline
Control & Control codes & \cellcolor{control}\textcolor{white}{Control} & K\%d.\%d+ or K\%02x\\
\thinhline
Data & Upper layer protocol data & \cellcolor{data}\textcolor{white}{Data} & D\%d.\%d+ or \%02x\\
\thinhline
Error & Malformed data & \cellcolor{error}\textcolor{white}{Error} & ERROR \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{8B/10B (TMDS)}
\label{filter:tmds}

Decodes the 8-to-10 Transition Minimized Differential Signalling line code used in \hyperref[filter:dvi]{DVI} and
\hyperref[filter:hdmi]{HDMI}.

Like the \hyperref[filter:8b10b]{8B/10B (IBM)} line code, TMDS is an 8-to-10 bit serial line code. TMDS, however, is
designed to \emph{minimize} the number of toggles in the data stream for EMC reasons, rendering it difficult to
synchronize a CDR PLL to. As a result, HDMI and DVI provide a reference clock at the pixel clock rate (1/10 the serial
data bit rate) along with the data stream to provide synchronization.

However, libscopeprotocols does not currently provide a frequency synthesis PLL which can recover a pixel clock from
the 1/10 rate clock (\issue{scopehal}{221}). As a result, it is currently necessary to perform per-lane CDR on the TMDS
data in order to decode it. This is sufficient for protocol decoding, but is not suitable for high-fidelity eye pattern
measurements since skew/jitter between the TMDS lane and the clock lane will not be accounted for.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/tmds.png}
\caption{Example TMDS decode}
\label{filter_tmds}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-tmds.png}
\caption{Example filter graph decoding TMDS from a single-ended input. Note that this example recovers the clock from
the input signal rather than multiplying up the reference clock.}
\label{filter_graph_tmds}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Digital & Serial TMDS data line \\
\thinhline
clk & Digital & DDR \emph{bit} clock, typically generated by use of the \hyperref[filter:cdrpll]{Clock Recovery
(PLL)} filter on the input data. Note that this is 5x the rate of the pixel clock signal. \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thinhline
Lane Number & Integer & Lane number within the link (0-3)\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

The TMDS filter outputs a time series of TMDS sample objects. These consist of a type field and a byte of data.

The output of the TMDS decode is commonly fed to the \hyperref[filter:dvi]{DVI} or \hyperref[filter:hdmi]{HDMI}
protocol decoders.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Stream name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Sparse protocol & Output decode \\
\thickhline
\end{tabularx}

\begin{tabularx}{16cm}{lllX}
\thickhline
\textbf{Type} & \textbf{Description} & \textbf{Color} & \textbf{Format} \\
\thickhline
Control & Control codes (H/V sync) & \cellcolor{control}\textcolor{white}{Control} & CTL\%d \\
\thinhline
Data & Pixel/island data & \cellcolor{data}\textcolor{white}{Data} & \%02x \\
\thinhline
Error & Malformed data & \cellcolor{error}\textcolor{white}{Error} & ERROR \\
\thinhline
Guard band & HDMI data/video guard band & \cellcolor{preamble}\textcolor{white}{Preamble} & GB \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{AC Couple}
\label{filter:accouple}

Automatically removes a DC offset from an analog waveform by subtracting the average of all samples from each sample.

This filter should only be used in postprocessing already acquired data, or other situations in which AC coupling in
the hardware (via an AC coupled probe, or coaxial DC block) is not possible.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/accouple.png}
\caption{Example input and output of the AC Couple filter}
\label{filter_accouple}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-accouple.png}
\caption{Example filter graph AC coupling an input waveform}
\label{filter_graph_accouple}
\end{figure}
\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter outputs an analog waveform with identical configuration (sparse or uniform) and sample rate to the input,
vertically shifted to center the signal at zero volts.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Stream name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Analog & Output decode \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{AC RMS}
\label{filter:acrms}

Measures the Root Mean Square amplitude of the waveform after removing any DC offset. The DC offset is calculated by
averaging all samples in the waveform.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/acrms.png}
\caption{Example usage of the AC RMS filter on a QAM modulated signal}
\label{filter_acrms}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-acrms.png}
\caption{Example filter graph measuring RMS value of a waveform}
\label{filter_graph_acrms}
\end{figure}
\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter has two output streams.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Stream name} & \textbf{Type} & \textbf{Description} \\
\thickhline
trend & Sparse analog & One sample per cycle of the input waveform containing the RMS value across that cycle \\
\thinhline
avg & Scalar & RMS value across the entire waveform \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Add}
\label{filter:add}

This filter adds two inputs. Either input may be a vector (waveform) or scalar.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/add.png}
\caption{Example usage of adding two analog waveforms}
\label{filter_add}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-add.png}
\caption{Example filter graph adding two analog waveforms}
\label{filter_graph_add}
\end{figure}
\FloatBarrier
\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
a & Analog waveform or scalar & First input waveform\\
\thinhline
b & Analog waveform or scalar & Second input waveform\\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

If both inputs are vectors, this filter outputs a waveform containing the pairwise sum; i.e. sample $i$ of the output
is $a[i] + b[i]$. No resampling is performed on the inputs so incorrect or unexpected results may occur if they do not
share the same timebase. Both inputs must be the same type (both sparse or both uniform), mixing sparse and uniform
(even if the sample timestamps are the same) is not allowed.

If both inputs are scalars, this filter outputs their sum.

If one input is a vector and the other is a scalar, this filter outputs the sum  of the scalar and each element of the
waveform, i.e. sample $i$ of the output is $a + b[i]$ for the scalar + vector case and $a[i] + b$ for the vector +
scalar.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Stream name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Analog & One sample per cycle of the input waveform containing the sum of the a and b inputs at that time \\
\thickhline
\end{tabularx}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Area Under Curve}
\label{filter:AreaUnderCurve}

Measures the area under the curve by integrating the data points. By default, area measured above ground is considered
as positive and area measured below the ground is considered negative (``true area"). The negative area can also be
considered as positive (``absolute area"). The measurement can be performed on the full record or on each
cycle.

The following examples demonstrate usage of the filter on a sinusoid.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/integral-full.png}
\caption{True area full record measurement. In this mode, the filter outputs $\int_{0}^{i} x$ at sample $i$, so we get
$\int sin(x) = cos(x)$.}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/integral-percycle.png}
\caption{True area per cycle measurement. In this mode, the filter outputs $\int_{t1}^{t2} x$ at each zero
crossing bounded interval so we get $\int_{0}^{2\pi} sin(x) = 0$ (plus measurement noise).}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/integral-abs-full.png}
\caption{Absolute area full record measurement. In this mode, the filter outputs $\int_{0}^{i} |x|$ at sample $i$, so
we get a continually increasing signal.}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/integral-abs-percycle.png}
\caption{Absolute area per cycle measurement. In this mode, the filter outputs $\int_{t1}^{t2} |x|$ at each zero
crossing bounded interval, so we get $\int{0}^{2\pi} |sin(x)| = 4$ (plus measurement noise).}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Measurement Type & Enum &
	\textbf{Full Record}: Measure the area of entire waveform \newline
	\textbf{Per Cycle}: Measure the area of each cycle in the waveform\\
\thinhline
Area Type & Enum &
	\textbf{True Area}: Consider area below ground as negative (integrate X)\newline
	\textbf{Absolute Area}: Consider area below ground as positive (integrate $|X|$)\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

For full record measurement, this filter outputs a waveform indicating total area measured till the time on the
waveform (integrating from zero to the current sample).

For per cycle measurement, this filter outputs a waveform representing area of each cycle (integrating between zero
crossings).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{ADL5205}
\label{filter:adl5205}

Decodes SPI data traffic to one half of an ADL5205 variable gain amplifier.

TODO: Screenshot

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
spi & SPI bus & The SPI data bus \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter outputs one ADL5205 sample object for each write transaction, formatted as ``write: FA=2 dB, gain=8 dB".

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Autocorrelation}
\label{filter:autocorrelation}

This filter calculates the autocorrelation of an analog waveform. Autocorrelation is a measure of self-similarity
calculated by multiplying the signal with a time-shifted copy of itself. In Fig. \ref{filter_autocorrelation}, strong peaks
can be seen at multiples of the 8b/10b symbol rate.

For best performance, it is crucial to keep the maximum offset as low as possible, since filter run time is
proportional to offset range multiplied by waveform length. A GPU implementation of this filter is planned for the
future (\issue{scopehal}{998}) which will significantly increase speed.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/autocorrelation.png}
\caption{Example waveforms showing autocorrelation of an 8b/10b signal}
\label{filter_autocorrelation}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-autocorrelation.png}
\caption{Example filter graph showing usage of autocorrelation filter}
\label{filter_graph_autocorrelation}
\end{figure}
\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Uniform analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Max offset & Integer & Maximum shift (in samples)\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an analog waveform with the same timebase as the input, one sample for each correlation offset.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Stream name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Uniform analog & Autocorrelation waveform \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Average}
\label{filter:average}

This filter calculates the average of its input.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/average.png}
\caption{Typical usage of average filter}
\label{filter_average}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-average.png}
\caption{Example filter graph showing usage of average filter}
\label{filter_graph_average}
\end{figure}
\FloatBarrier

\subsection{Inputs}
\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
in & Analog or scalar & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
latest & Scalar & Average of the filter's current input \\
\thinhline
cumulative & Scalar & Average of all input since the last clear-sweeps\\
\thinhline
totalSamples & Scalar & Total number of integrated samples \\
\thinhline
totalWaveforms & Scalar & Total number of integrated waveforms \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Bandwidth}

Calculates the -3 dB bandwidth of a network, given the insertion loss magnitude.

The bandwidth is measured relative to a user-specified reference level; for example the bandwidth of a -20 dB
attenuator can be measured by setting the reference level to -20 dB.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/bandwidth.png}
\caption{Measuring the -3 dB bandwidth of a cable}
\label{filter_bandwidth}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-bandwidth.png}
\caption{Example filter graph showing usage of bandwidth filter on an imported Touchstone file}
\label{filter_graph_bandwidth}
\end{figure}
\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform (typically S21) \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Reference Level & Float & Nominal (DC / mid band) insertion loss of the network\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a scalar containing the first frequency in the network which is at least -3 dB below the reference
level. If the input waveform is entirely below this level, the lowest frequency in the input is returned. If the
input waveform is entirely above this level, the highest frequency in the input is returned.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Scalar & Calculated bandwidth \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Base}
\label{filter:base}

Calculates the base (average logical zero level) of a digital waveform.

It is most commonly used as a scalar to view the base of the entire waveform. At times, however, it may be useful to
view the base waveform. For example, in Fig. \ref{filter_base}, the vertical eye closure caused by channel ISI is
readily apparent.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/base.png}
\caption{Example of base measurement on a serial data stream}
\label{filter_base}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-base.png}
\caption{Example filter graph showing usage of base filter}
\label{filter_graph_base}
\end{figure}
\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
trend & Analog & Cycle-by-cycle base \\
\thinhline
avg & Scalar & Average base of the entire waveform \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{BIN Import}

Loads an Agilent / Keysight / Rigol binary waveform file.

%\begin{figure}[h]
%\centering
%\bigimage{images/filters/autocorrelation.png}
%\caption{Example of autocorrelation on a serial data stream}
%\label{filter_accouple}
%\end{figure}

\subsection{Inputs}

This filter takes no inputs.

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
BIN File & Filename & Path to the file being imported\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a uniformly sampled analog waveform for each channel in the file. The number of output streams is
variable based on how many channels are present in the file.

NOTE: Waveform files generated by the Rigol MSO5000 and possibly other scopes using a similar firmware stack are known
to be malformed and will not load properly. We are exploring ways to repair and load these damaged files in the future
(\issue{scopehal}{975}).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Burst Width}

Measures the burst width of each burst in a waveform. A burst is a sequence of adjacent crossings of the average value
of the waveform (for analog waveforms) or toggles (for digital waveforms).

The burst width is the duration of this sequence. Bursts are separated by a user-defined idle time that can be provided
as a parameter to this filter. The measurement is made on each burst in the waveform.

\begin{figure}[h]
	\centering
	\bigimage{ng-images/filters/burstwidth.png}
	\caption{Example of burst width measurement}
	\label{filter_burstwidth}
	\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-burstwidth.png}
\caption{Example filter graph showing usage of burst width filter}
\label{filter_graph_base}
\end{figure}
\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Idle Time & Integer & Minimum idle time with no toggles, before declaring start of a new burst\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a sparse analog waveform with one sample for each burst in the input signal.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Bus Heatmap}

Computes a ``spectrogram" visualization of bus activity with address on the Y axis and time on the X axis, in order to
identify patterns in memory or bus activity.

The current version only supports CAN bus however other common memory interfaces will be added in the future.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/bus-heatmap.png}
\caption{CAN bus activity on a car's OBD port showing the vehicle being started, running for 50 seconds, then shutting down}
\label{filter_busheatmap}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-bus-heatmap.png}
\caption{Example filter graph showing usage of bus heatmap filter on an imported CAN bus capture}
\label{filter_graph_busheatmap}
\end{figure}
\FloatBarrier

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Max Address & Integer & Maximum address to display in the plot \\
\thinhline
X Bin Size & Integer & Width of each pixel in the X axis (timebase units) \\
\thinhline
Y Bin Size & Integer & Number of addresses to merge into each pixel in the Y axis \\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a 2D density plot that is (max address) / (y bin size) pixels high and (memory depth) / (x bin
size) pixels wide, spanning the entire duration of the input and the full address range requested.

All packets within the input waveform have the start time and address rounded to the closest bin in X and Y. The
corresponding pixel in the integration buffer is incremented, then the final waveform is normalized to cover the full
range of the selected color ramp.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Density map & Calculated heatmap \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{CAN}
\label{filter:can}

Decodes the Control Area Network (CAN) bus, commonly used in vehicle control systems. Both standard (11 bit) and
extended (29 bit) IDs are supported.

CAN-FD frames are detected and flagged as such, but the current decode cannot parse them fully. Full support is planned
(\issue{scopehal}{334}).

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/can.png}
\caption{Example of decoding a single extended-format frame with 3 bytes of data}
\label{filter_can}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-can.png}
\caption{Example filter graph showing usage of CAN bus decode}
\label{filter_graph_can}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/packet-can.png}
\caption{Example packet output}
\label{packet_can}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
CANH & Digital & Thresholded CANH (or CANH-CANL) signal \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Bit Rate & Integer & Bit rate of the bus (most commonly 250 or 500 Kbps)\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

The CAN bus decode outputs a time series of CAN sample objects. These consist of a type field and a byte of data.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Protocol & Decoded waveform data \\
\thickhline
\end{tabularx}

\begin{tabularx}{16cm}{lllX}
\thickhline
\textbf{Type} & \textbf{Description} & \textbf{Color} & \textbf{Format} \\
\thickhline
Control & Start of frame & \cellcolor{preamble}\textcolor{white}{Preamble} & SOF \\
\thinhline
ID & CAN ID & \cellcolor{address}\textcolor{black}{Address} & ID \%x \\
\thinhline
RTR & Remote Transmission Request & \cellcolor{control}\textcolor{white}{Control} & DATA | REQ \\
\thinhline
FD mode & CAN-FD mode & \cellcolor{control}\textcolor{white}{Control} & FD | STD\\
\thinhline
R0 & Reserved bits & \cellcolor{preamble}\textcolor{white}{Preamble} & RSVD \\
\thinhline
DLC & Data Length Code & \cellcolor{control}\textcolor{white}{Control} & Len 3 \\
\thinhline
Data & Payload data & \cellcolor{data}\textcolor{white}{Data} & \%02x \\
\thinhline
Valid CRC & Good checksum & \cellcolor{checksumok}\textcolor{black}{Checksum OK} & CRC: \%04x \\
\thinhline
Invalid CRC & Bad checksum & \cellcolor{checksumbad}\textcolor{white}{Checksum Bad} & CRC: \%04x \\
\thinhline
CRC delimiter & Bus turnaround & \cellcolor{preamble}\textcolor{white}{Preamble} & CRC DELIM \\
\thinhline
ACK & Acknowledgement & \cellcolor{checksumok}\textcolor{black}{Checksum OK} & ACK \\
\thinhline
NAK & Missing acknowledgement & \cellcolor{checksumbad}\textcolor{white}{Checksum Bad} & NAK \\
\thinhline
ACK delimiter & Bus turnaround & \cellcolor{preamble}\textcolor{white}{Preamble} & ACK DELIM \\
\thinhline
EOF & End of frame & \cellcolor{preamble}\textcolor{white}{Preamble} & EOF \\

\thickhline
\end{tabularx}

\subsection{Protocol Analyzer}

TODO

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{CAN Analyzer}
\label{filter:cananalyzer}

This filter adds a protocol analyzer table to CAN data sources which do not natively provide one.

The most common use of this block is processing packets acquired from the \hyperref[driver:socketcan]{socketcan}
driver, since the current libscopehal object model does not allow instruments to output protocol packets directly.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{CAN Bitmask}
\label{filter:canbitmask}

Extracts a bit-masked value from a stream of CAN bus packets and outputs a Boolean waveform.

The typical use of this is to display a Boolean control or status signal, such as turn signal indicator state, as a
waveform.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/can-bitmask.png}
\caption{Example of decoding several bitfields from a CAN bus waveform}
\label{filter_can}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-can-bitmask.png}
\caption{Example filter graph showing usage of CAN bitmask decode}
\label{filter_graph_can}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & CAN bus & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Bus Address & Hex & CAN ID to match\\
\thinhline
Initial Value & Bool & Starting value to display before the first matching CAN packet is seen\\
\thinhline
Pattern Bitmask & Hex & 64-bit mask for selecting bits within the CAN packet\\
\thinhline
Pattern Target & Hex & 64-bit pattern to look for\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a sparse digital waveform with one sample per CAN packet matching the target CAN ID.

If the packet value, interpreted as a 64-bit big endian integer, equals the target when ANDed with the bitmask, the
output is 1. Otherwise the output is zero.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Can-Utils Import}

Loads a log file generated by the \codestyle{candump} utility from the Linux \codestyle{can-utils} software package and
displays it as a series of CAN packets.

Example capture command: \codestyle{candump -l can0}

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Channel Emulation}
\label{filter:channelemu}

This filter models the effects of applying an arbitrary channel, described via a single path of a set of S-parameters,
to a waveform. Fig. \ref{filter_channelemu} shows the result of passing a 10.3125 Gbps PRBS through S21 of a 300mm FR-4
channel with insertion loss of approximately 7 dB at the fundamental. The ISI and phase shift introduced by the channel
can be seen clearly.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/channel-emulation.png}
\caption{Example of channel emulation on a serial data stream}
\label{filter_channelemu}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-channel-emulation.png}
\caption{Example filter graph showing usage of channel emulation filter}
\label{filter_graph_channelemu}
\end{figure}

The channel model works in the frequency domain. An FFT is performed on the input, then each complex point is scaled by
the interpolated magnitude and rotated by the phase, then an inverse FFT is used to transform the signal back into the
time domain.

The group delay of the channel is then estimated and samples are discarded from the beginning of the waveform to
prevent causality violations. For example, when performing channel emulation using a network with a 1ns group delay,
the output waveform will begin 1ns after the input (since the channel output before this depends on input samples
before the start of the waveform). Note that the automatic group delay estimation uses points from roughly the center
of the S-parameter dataset in the current implementation; channels which do not have a significant passband around this
frequency will give incorrect group delay estimates. The ``Group Delay Truncation Mode" parameter can be set to manual
in this case, selecting the ``Group Delay Truncation" parameter instead of the automatically estimated value.

By choosing appropriate stimulus waveforms and S-parameter paths, many different kinds of analysis can be performed.
For example, given a 4-port network describing two transmission lines (with ports 1 and 3 as input, and 2 and 4 as
output):
\begin{itemize}
\item Applying $S_{11}$ to a step or impulse waveform gives TDR response of the port 1-2 channel.
\item Applying $S_{21}$ to an impulse waveform gives impulse response of the port 1-2 channel
\item Applying $S_{21}$ to a serial data stream gives the port 1-2 signal as it would be seen by a receiver
\item Applying $S_{31}$ to a serial data stream gives the NEXT between the port 1-2 and 3-4 channels
\item Applying $S_{41}$ to a serial data stream gives the FEXT between the port 1-2 and 3-4 channels
\end{itemize}

Note that only the single S-parameter path provided is considered, and reflections elsewhere in the system are not
modeled. As a result, multiple applications of this filter to emulate a large circuit piecewise (for example, a cable
followed by a fixture) may give inaccurate results since reflections between the two networks are not considered. In
this situation, it is preferable to use a circuit simulator or the S-Parameter Cascade filter to calculate combined
S-parameters of the entire circuit and then perform the channel emulation once.

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
signal & Analog & Input waveform \\
\thinhline
mag & Analog & S-parameter magnitude channel \\
\thinhline
ang & Analog & S-parameter angle channel \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Max Gain & Float & Maximum gain to apply\\
\thinhline
Group Delay Truncation & Int & Group delay override for manual mode\\
\thinhline
Group Delay Truncation Mode & Enum & Specifies manual or automatically estimated group delay\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an analog waveform with the same timebase as the input, with the emulated channel applied.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Clip}
\label{filter:clip}

This filter limits the maximum or minimum value of a waveform to a given value. It can be configured
to clip ``above" in which case it imposes an upper limit or ``below" in which case it imposes a lower
limit.

Clipping both top and bottom is not currently supported, however two instances of the filter can be chained to achieve
the same result.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/clip.png}
\caption{Example of clipping a sinewave}
\label{filter_clip}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-clip.png}
\caption{Example filter graph showing usage of clip filter}
\label{filter_graph_clip}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Behavior & Enum & Select between clipping values above or below selected value\\
\thinhline
Level & Float & Maximum/minimum signal level\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an analog waveform with the same timebase as the input, clipped as specified by the parameters.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Clock Recovery (D-PHY HS Mode)}

Extracts a double-rate clock from a MIPI D-PHY clock+data stream, which is gated to only toggle when the data input
is in HS mode. This can be used for generating eye patterns of the HS-mode data.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Clock Recovery (PLL)}
\label{filter:cdrpll}

This filter uses a PLL to recover a clock from a serial NRZ data stream. The recovered clock is double-rate and phased
90\textdegree with respect to the data, such that the data can be sampled directly by both edges of the PLL output
clock.

When the optional clock gating input is low, the output does not toggle and any edges in the input signal are ignored.
This is most commonly used as a squelch to disable decoding and eye processing in between bursts of data. As soon as
the gate goes high, the PLL will instantly phase shift the internal NCO to align with the next transition in the input
signal and then begin running closed-loop continuing from the previous NCO frequency value.

This filter uses a single threshold suitable for NRZ inputs. Using either the upper or lower level is also sufficient
for MLT-3 since the +1 to -1 crossing is disallowed, but attempting to do the same on a PAM signal will add
data-dependent jitter (since the slew rate for, for example, a -2 to +2 transition is different than that for a -1 to
+1 transition). For proper results on PAM signals, use the \hyperref[filter:pamedge]{PAM edge detector} filter to find
level crossings and then apply the CDR to the detected transitions.

The current implementation of this filter uses a simple bang-bang control loop which is reasonably fast and provides
generally acceptable jitter transfer performance for most purposes (passing high frequency jitter but rejecting spread
spectrum modulation), but does not precisely match the jitter transfer characteristics of any particular serial data
standard. In the future, several standard PLL responses including the Fibre Channel golden PLL (\issue{scopehal}{163})
will be supported as options.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/cdrpll.png}
\caption{Example of CDR PLL on a serial data stream}
\label{filter_cdrpll}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-cdrpll.png}
\caption{Example filter graph showing usage of CDR PLL filter}
\label{filter_cdrpll}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
IN & Analog or digital & Input waveform \\
\thinhline
Gate & Digital & Clock enable signal. Leave unconnected to disable gating. \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Symbol rate & Float & Symbol rate, in Hz\\
\thinhline
Threshold & Float & Decision threshold for the edge detector, in volts. Ignored for digital inputs.\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an digital waveform with one sample per transition of the recovered clock.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Clock Recovery (UART)}
\label{filter:cdruart}

This filter uses a DLL to recover a sampling clock from UART or similar protocol at a known baud rate. The single-rate
recovered clock idles low and toggles for each bit in each frame and is phased 90\textdegree with respect to data, such
that each bit can be sampled on the rising edge of the DLL output clock. This filter can be used for generating an eye
pattern of the serial signal.

The current implementation limits support to serial protocols with 10 bits/symbols per frame. Consider using the
\hyperref[filter:cdrpll]{PLL-based clock recovery} for unsupported serial formats if applicable.

The current implementation does not synchronize by aligning falling clock edges with symbol edges.

\begin{figure}[h]
\centering
\bigimage{images/filters/cdruart.png}
\caption{Example of UART CDR on two serial data frames separated by a short delay}
\label{filter_cdruart}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Baud rate & Float & Symbol rate, in bps \\
\thinhline
Threshold & Float & Decision threshold for the edge detector, in volts \\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a digital waveform with the sampling clock recovered from the analog stream.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Complex Import}

Loads waveform data from a raw binary file containing I/Q samples in one of several formats. Regardless of sample
format, the samples must be interleaved in I-Q-I-Q order.

Supported formats (native endianness, no byte swapping is performed):
\begin{itemize}
\item Signed int8
\item Unsigned int8
\item Signed int16
\item Float32
\item Float64
\end{itemize}

Integer sample data is rescaled to a nominal +/- 1V p-p. Floating point data is not rescaled and the raw floating point
values are output as volts.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/complex-spectrogram.png}
\caption{Example of importing and processing complex data}
\label{filter_compleximport}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-complex-spectrogram.png}
\caption{Example filter graph showing usage of complex import filter}
\label{filter_compleximport_graph}
\end{figure}

\FloatBarrier

\subsection{Inputs}

This filter takes no inputs.

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Complex File & String & Path to the input file\\
\thinhline
File Format & Enum & Data type of the samples\\
\thinhline
Sample Rate & Int & Sampling frequency\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs two streams named ``I" and ``Q" containing the I/Q waveform data.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Complex Spectrogram}

Plots a spectrogram of complex I/Q data.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/complex-spectrogram.png}
\caption{Example of a complex spectrogram}
\label{filter_complexspectrogram}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-complex-spectrogram.png}
\caption{Example filter graph showing usage of complex spectrogram filter}
\label{filter_complexspectrogram_graph}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
I & Analog & Real part of input signal\\
\thinhline
Q & Analog & Imaginary part of input signal\\
\thinhline
center & Analog scalar & IF frequency to display the zero point of the complex waveform at\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
FFT length & Int & Number of FFT points per spectrogram\\
\thinhline
Range Max & Float & Amplitude, in dBm, to use as the full-scale intensity value\\
\thinhline
Range Min & Float & Amplitude, in dBm, to use as the minimum-scale intensity value\\
\thinhline
Window & Enum & Window function to use for the FFTs\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a 2D density plot showing amplitude vs frequency and time.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Constant}
\label{filter:constant}

This filter outputs a scalar with a constant value, which may be used as input to other filter graph blocks.

\subsection{Inputs}

This filter takes no inputs.

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Value & Float & The value to output\\
\thinhline
Unit & Enum & Data type of the constant value\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a single scalar with a constant value.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Constellation}
\label{filter:constellation}

This filter takes I/Q streams and a double-rate recovered symbol clock and outputs a constellation diagram.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/constellation.png}
\caption{Example of a 9-point 2D-PAM3 constellation}
\label{filter_constellation}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-constellation.png}
\caption{Example filter graph showing usage of constellation filter on 2D-PAM3 data}
\label{filter_complexspectrogram_graph}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
I & Analog & Real part of input signal\\
\thinhline
Q & Analog & Imaginary part of input signal\\
\thinhline
clk & Digital & Recovered symbol clock \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Center I & Float & Voltage for center of the constellation in I axis\\
\thinhline
Center Q & Float & Voltage for center of the constellation in Q axis\\
\thinhline
Modulation & Enum & Modulation to use for EVM calculations\\
\thinhline
Range & Float & Nominal full-scale range\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a 2D density plot showing amplitude vs frequency and time, as well as error vector magnitude (EVM)
measurements.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Density plot & Constellation image\\
\thinhline
EVM raw & Analog scalar & Raw EVM in volts\\
\thinhline
EVM normalized & Analog scalar & Normalized EVM in percent\\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Coupler De-Embed}
\label{filter:couplerdbed}

Given waveforms from both coupled ports of a dual directional coupler and the S-parameters of the coupler, de-embeds
the coupler response in order to recover the forward and reverse waveforms.

NOTE: The current implementation of this filter requires the \codestyle{VK\_KHR\_push\_descriptor} Vulkan extension. A
fallback implementation for GPUs without this extension will be added at some point in the future.

Both coupled-port waveforms must be the same sample rate, memory depth, and de-skewed relative to one another.

This filter uses a multi-step algorithm to de-embed both the insertion loss of the coupled path and enhance the
apparent directivity of the coupler:

\begin{enumerate}

\item De-embed the coupled path response from the coupled port waveforms in order to calculate an initial estimate of
the input port waveforms. The same FFT-based algorithm as the \hyperref[filter:deembed]{De-Embed} filter is used.

\item Given the initial estimated input port waveforms, calculate the leakage from the forward path to the reverse
coupled port, and from the reverse path to the forward coupled port. The same FFT-based algorithm as the
\hyperref[filter:channelemu]{Channel Emulation} filter is used. This estimate is imperfect since it assumes perfect
directivity, so a small amount of the legitimate waveform is incorrectly included in the leakage waveform.

\item Subtract the leakage waveforms from the measured coupled port waveforms. This removes most of the leakage (as
well as a small amount of the legitimate waveform).

\item De-embed the coupled path response from the subtracted waveform in order to get a revised estimate of input
port waveforms. This is the final output of the filter.

\end{enumerate}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
forward & Analog & Forward coupled port waveform \\
\thinhline
reverse & Analog & Reverse coupled port waveform \\
\thinhline
forwardCoupMag & Analog & Magnitude response of forward coupled path \\
\thinhline
forwardCoupAng & Analog & Angle response of forward coupled path \\
\thinhline
reverseCoupMag & Analog & Magnitude response of reverse coupled path \\
\thinhline
reverseCoupAng & Analog & Angle response of reverse coupled path \\
\thinhline
forwardLeakMag & Analog & Magnitude response of forward leakage path \\
\thinhline
forwardLeakAng & Analog & Angle response of forward leakage path \\
\thinhline
reverseLeakMag & Analog & Magnitude response of reverse leakage path \\
\thinhline
reverseLeakAng & Analog & Angle response of reverse leakage path \\
\thickhline
\end{tabularx}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{CSV Export}

Saves waveform data to a comma-separated-value file.

The Update Mode parameter specifies how and when the file is modified:
\begin{itemize}
\item \textbf{Append (continuous):} Every time the filter graph runs, the inputs are appended to the end of the file.
\item \textbf{Append (manual):} When the ``Export" button in the filter properties box is clicked,
the inputs are appended to the end of the file.
\item \textbf{Overwrite (continuous):} Every time the filter graph runs, the input waveforms replace the current contents
of the file.
\item \textbf{Overwrite (manual):} When the ``Export" button in the filter properties box is clicked,
the input waveforms replace the current contents of the file.
\end{itemize}

\subsection{Inputs}

This filter takes a variable number of inputs, named ``column1", ``column2", etc, which may be of analog, digital, or
arbitrary protocol type. 2D persistence maps are not supported.

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
File name & String & Path to the CSV file\\
\thinhline
Update mode & Enum & Specifies how and when to update the file)\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter stores its output to a file and has no filter graph output ports.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{CSV Import}

Loads waveform data from a comma-separated-value file.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Current Shunt}

Converts a voltage waveform acquired across a known resistance into a current waveform.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{DDJ}
\label{filter:ddj}

Calculates the peak-to-peak data-dependent jitter for a serial data stream.

This filter uses the non-repeating-pattern method, which allows DDJ to be computed for arbitrary waveforms rather than
requiring a short, repeating PRBS. In this method, per-UI jitter (TIE) measurements are split across $2^n$ histogram
bins, one for each possible combination of the preceding $n$ bits. The jitter samples for each bin are then averaged to
remove the effects of other jitter, leaving only the DDJ.  The final DDJ value is reported as the difference between
the minimum and maximum histogram bins.

The current implementation uses a fixed window size of $n=8$ UI. If the channel has significant memory effects or
reflections with delays of more than 8 UI, DDJ maybe underestimated.

The current implementation only supports NRZ signals and cannot measure DDJ for MLT3 or PAM waveforms.

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
TIE & Analog & TIE waveform computed by the \hyperref[filter:tie]{TIE} filter\\
\thinhline
Threshold & Digital & Thresholded digital sample values\\
\thinhline
Clock & Digital & Double rate, center aligned sampling clock for threshold values\\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter outputs an analog waveform with a single sample containing the computed DDJ value.

Additionally, the raw DDJ histogram is stored internally and may be accessed by other filters via the C++ API. There is
currently no way to display the histogram content.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{DDR1 Command Bus}

Decodes the command bus for first-generation DDR SDRAM.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{DDR3 Command Bus}

Decodes the command bus for third-generation DDR SDRAM.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{De-Embed}
\label{filter:deembed}

Applies the inverse of a channel (described by a single path in an S-parameter dataset, normally $S_{21}$) to a signal,
in order to calculate what the waveform would have looked like at the input to a cable, fixture, etc. given the signal
seen at the output.

The channel model works in the frequency domain. An FFT is performed on the input, then each complex point is scaled by
the interpolated magnitude and rotated by the phase, then an inverse FFT is used to transform the signal back into the
time domain.

The group delay of the channel is then estimated and samples are discarded from the end of the waveform to prevent
causality violations. For example, when performing a de-embed using a network with a 1ns group delay, the output
waveform will end 1ns before the input does (since the channel output after this depends on input samples after the end
of the stimulus waveform). Note that the automatic group delay estimation uses points from roughly the center of the
S-parameter dataset in the current implementation; channels which do not have a significant passband around this
frequency will give incorrect group delay estimates. The ``Group Delay Truncation Mode" parameter can be set to manual
in this case, selecting the ``Group Delay Truncation" parameter instead of the automatically estimated value.

Note that only the single S-parameter path provided is considered, and reflections elsewhere in the system are not
modeled. As a result, multiple applications of this filter to de-embed a large circuit piecewise (for example, a cable
followed by a probe) may give inaccurate results since reflections between the two networks are not considered. In this
situation, it is preferable to use a circuit simulator or the \hyperref[filter:sparamcascade]{S-Parameter Cascade}
filter to calculate combined S-parameters of the entire circuit and then perform a single de-embed.

The maximum gain the de-embed applies is capped (default 20 dB) in order to prevent amplifying noise outside the
passband of the network being de-embedded.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/deembed.png}
\caption{Example of de-embedding a cable from a measurement}
\label{filter_deembed}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-deembed.png}
\caption{Example filter graph showing usage of de-embed filter}
\label{filter_deembed_graph}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
signal & Analog & Input waveform \\
\thinhline
mag & Analog & S-parameter magnitude channel \\
\thinhline
ang & Analog & S-parameter angle channel \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Max Gain & Float & Maximum gain to apply\\
\thinhline
Group Delay Truncation & Int & Group delay override for manual mode\\
\thinhline
Group Delay Truncation Mode & Enum & Specifies manual or automatically estimated group delay\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an analog waveform with the same timebase as the input, with the emulated channel applied.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Deskew}
\label{filter:deskew}

Moves an analog waveform earlier or later in time to compensate for trigger offsets, probe length mismatch, etc. It is
generally preferable to deskew using the skew adjustment on the channel during acquisition if supported by hardware;
this filter is provided for correction in postprocessing or for use with instruments that do not have hardware deskew
capability.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/deskew.png}
\caption{Example of deskewing a signal}
\label{filter_deskew}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-deskew.png}
\caption{Example filter graph showing usage of deskew filter}
\label{filter_deskew_graph}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Skew & Float & Time offset to shift the waveform\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an analog waveform with one sample for each sample in the input, phase shifted by the requested
offset.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Digital to NRZ}
\label{filter:digitaltonrz}

Convert a digital signal (and associated clock) to an analog NRZ waveform. This filter uses a simplistic piecewise
linear rise/fall time model: the output stays at the logic low/high voltage until the input changes, then ramps at a
constant rate to the new value. For more accurate modeling of edge shape use the \hyperref[filter:ibisdriver]{IBIS
Driver} filter with the appropriate IBIS model for your DUT.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/digital-to-nrz.png}
\caption{Example of converting digital waveform to analog NRZ}
\label{filter_digital_to_nrz}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-digital-to-nrz.png}
\caption{Example filter graph showing usage of digital to NRZ filter}
\label{filter_digital_to_nrz_graph}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Digital & Digital data to send\\
\thinhline
clk & Digital & Clock for data\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Level 0 & Float & Voltage to send when the input is a logic 0\\
\thinhline
Level 1 & Float & Voltage to send when the input is a logic 1\\
\thinhline
Sample Rate & Int & Sample rate for the generated waveform\\
\thinhline
Transition Time & Int & Rising and falling edge time\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an analog NRZ version of the provided digital input, sampled uniformly at the specified rate.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Digital to PAM4}
\label{filter:digitaltopam4}

Convert a digital signal (and associated clock) to an analog PAM-4 waveform. This filter uses a simplistic piecewise
linear rise/fall time model: the output stays at the current symbol's voltage until the input changes, then ramps at a
constant rate to the new value. For more accurate modeling of edge shape use the \hyperref[filter:ibisdriver]{IBIS
Driver} filter with the appropriate IBIS model for your DUT.

The input data is a digital serial bit stream at twice the PAM4 symbol rate. Two consecutive input bits map to a single
PAM-4 output sample.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/digital-to-pam4.png}
\caption{Example of converting digital waveform to analog PAM-4}
\label{filter_digital_to_pam4}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-digital-to-pam4.png}
\caption{Example filter graph showing usage of digital to PAM-4 filter}
\label{filter_digital_to_pam4_graph}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Digital & Serial digital data to send\\
\thinhline
clk & Digital & Clock for data\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Level 00 & Float & Voltage to send when the input is a logic 0-0\\
\thinhline
Level 01 & Float & Voltage to send when the input is a logic 0-1\\
\thinhline
Level 10 & Float & Voltage to send when the input is a logic 1-0\\
\thinhline
Level 11 & Float & Voltage to send when the input is a logic 1-1\\
\thinhline
Sample Rate & Int & Sample rate for the generated waveform\\
\thinhline
Transition Time & Int & Rising and falling edge time\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an analog PAM-4 version of the provided digital input, sampled uniformly at the specified rate.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{DisplayPort - Aux Channel}

Decodes the Auxiliary Channel of DisplayPort

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Divide}

Divides one waveform by another.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Downconvert}

Performs digital downconversion by mixing a directly sampled RF signal with a two-phase local oscillator, then outputs
the downconverted signal. No LO rejection filtering or decimation is performed.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Downsample}

Optionally low-pass filters a signal to prevent aliasing, then decimates by an integer factor.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/downsample.png}
\caption{Example of downsampling a sinusoid}
\label{filter_downsample}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-downsample.png}
\caption{Example filter graph showing usage of downsample filter}
\label{filter_downsample}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
RF & Analog & Input waveform\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Antialiasing Filter & Bool & If true, applies a low-pass filter to the input before decimating\\
\thinhline
Downsample Factor & Int & Divisor for output sample rate\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a decimated version of the input.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{DRAM Clocks}

Given a DRAM command bus and a DQS strobe, produce separate gated DQ clock streams for read and write bursts.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{DRAM Trcd}

Calculates $T_{rcd}$ (RAS-to-CAS delay) for each newly opened row in a DRAM command bus stream.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{DRAM Trfc}

Calculates $T_{rfc}$ (refresh-to-refresh delay) for each refresh operation in a DRAM command bus stream.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Duty Cycle}

Calculates the duty cycle of a bimodal waveform. The duty cycle is defined as the percentage of time spent in the high
state divided by the period.

Analog waveforms are automatically thresholded at the average voltage.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/dutycycle.png}
\caption{Example of measuring duty cycle of a digital waveform}
\label{filter_dutycycle}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-dutycycle.png}
\caption{Example filter graph showing usage of duty cycle filter}
\label{filter_dutycycle}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog or digital & Input waveform\\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
trend & Analog & Instantaneous duty cycle of each cycle of the waveform\\
\thinhline
avg & Analog scalar & Average duty cycle over the entire input signal \\
\thickhline
\end{tabularx}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{DVI}
\label{filter:dvi}

Decodes Digital Visual Interface (DVI) video signals.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/tmds.png}
\caption{Example of decoding a DVI signal}
\label{filter_dvi}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-tmds.png}
\caption{Example filter graph showing usage of DVI decode filter}
\label{filter_dvi}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
D0 (blue) & Protocol & TMDS decode for lane 0\\
\thinhline
D1 (green) & Protocol & TMDS decode for lane 1\\
\thinhline
D2 (blue) & Protocol & TMDS decode for lane 2\\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

The output is a sequence of DVI scan lines including RGB pixel values.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Emphasis}

Adds pre/de emphasis to a signal by convolving it with a tapped delay line filter. This introduces a small phase shift.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/emphasis.png}
\caption{Example of applying 6 dB of de-emphasis to a 1.25 Gbps 8B/10B signal}
\label{filter_emphasis}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-emphasis.png}
\caption{Example filter graph showing usage of emphasis filter}
\label{filter_emphasis}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
in & Analog & Input waveform\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Data Rate & Int & Data rate, in symbols per second\\
\thinhline
Emphasis Amount & Float & Amount of pre/de emphasis to add, in dB\\
\thinhline
Emphasis Type & Enum & Type of emphasis to add (pre-emphasis or de-emphasis) \\
\thickhline
\end{tabularx}

\subsection{Output Signal}

The output is an analog signal with the requested amount of emphasis applied.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Emphasis Removal}

Removes pre/de emphasis from a signal by convolving it with a tapped delay line filter. This introduces a small phase
shift.

This filter is typically used when probing a signal at the transmitter which has a high level of emphasis. Removing the
emphasis can increase the eye opening in the digitized signal and make interpretation easier.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/emphasis-removal.png}
\caption{Example of applying 6 dB of de-emphasis to a 1.25 Gbps 8B/10B signal then removing it}
\label{filter_emphasis}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-emphasis-removal.png}
\caption{Example filter graph showing usage of emphasis removal filter}
\label{filter_emphasis}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
in & Analog & Input waveform\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Data Rate & Int & Data rate, in symbols per second\\
\thinhline
Emphasis Amount & Float & Amount of pre/de emphasis to remove, in dB\\
\thinhline
Emphasis Type & Enum & Type of emphasis to remove (pre-emphasis or de-emphasis) \\
\thickhline
\end{tabularx}

\subsection{Output Signal}

The output is an analog signal with the requested amount of emphasis removed.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Enhanced Resolution}
\label{filter:eres}

Applies a FIR low-pass filter to a signal to increase the vertical resolution and reduce noise at the cost of reduced
bandwidth. This technique assumes a small amount of Gaussian noise is present in the input waveform, such that a signal
whose true value is midway between two ADC codes will randomly fluctuate between the two quantized values, with an
average equal to the true value.

Each half bit of resolution reduces the bandwidth by an additional factor of two beyond the Nyquist limit. For example,
a 1.5 bit resolution improvement reduces the bandwith to Fnyquist / 8. The filter properties dialog displays the
calculated -3 dB bandwidth based on the current input sample rate.

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
in & Analog & Input signal\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Bits & Enum & Number of additional bits of resolution to add\\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Envelope}
\label{filter:envelope}

Finds the minimum and maximum of each sample in the input over time, and outputs them as separate streams.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet - 10baseT}

Decodes the 10base-T Ethernet PCS/PMA as specified in IEEE 802.3-2018 clause 14.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet - 100baseT1}

Decodes the 100base-T1 single-pair / automotive Ethernet PMA/PCS, as specified in IEEE 802.3-2018 clause 96.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet - 100baseT1 Link Training}

Decodes the link training stage of 100base-T1 single-pair / automotive Ethernet, as specified in IEEE
802.3-2018 clause 96.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet - 100baseTX}

Decodes the 100base-TX Ethernet PMA/PCS as specified in IEEE 802.3-2018 clause 24 and 25, and the ANSI X3T12 FDDI PHY.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet - 1000baseX}
\label{filter:1000basex}

Decodes the 1000base-X Ethernet PCS as specified in IEEE 802.3-2018 clause 36.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & 8b/10b & Output of \hyperref[proto:8b10b]{8b/10b protocol decode}\\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

The 1000base-X filter outputs a series of Ethernet frame segment objects.

\begin{tabularx}{16cm}{lllX}
\thickhline
\textbf{Type} & \textbf{Description} & \textbf{Color} & \textbf{Format} \\
\thickhline
Preamble & Preamble & \cellcolor{preamble}\textcolor{white}{Preamble} & PREAMBLE \\
\thinhline
Preamble & Start of frame delimiter & \cellcolor{preamble}\textcolor{white}{Preamble} & SFD \\
\thinhline
Address & Src/dest MAC & \cellcolor{address}\textcolor{black}{Address} & From 02:00:11:22:33:44 \\
\thinhline
Control & Ethertype & \cellcolor{control}\textcolor{white}{Control} & Type: IPv4 \newline Type: 0xbeef \\
\thinhline
Control & VLAN tag & \cellcolor{control}\textcolor{white}{Control} & VLAN 10, PCP 0 \\
\thinhline
Data & Frame data & \cellcolor{data}\textcolor{white}{Data} & a5 \\
\thinhline
Checksum OK & Valid FCS & \cellcolor{checksumok}\textcolor{black}{Checksum OK} & CRC: 0xdeadbeef \\
\thinhline
Checksum Bad & Invalid FCS & \cellcolor{checksumbad}\textcolor{white}{Checksum Bad} & CRC: 0xbaadc0de \\
\thinhline
Error & Malformed data & \cellcolor{error}\textcolor{white}{Error} & ERROR \\
\thickhline
\end{tabularx}

TODO: Document protocol analyzer output

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet - 10Gbase-R}
\label{filter:10gbaser}

Decodes the 10Gbase-R Ethernet PCS as specified in IEEE 802.3-2018 clause 49.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\pagebreak
%\section{Ethernet - GMII}

%Decodes the Gigabit Media Independent Interface as specified in IEEE 802.3-2018 clause 35.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet - QSGMII}
\label{filter:qsgmii}

Converts a 5 Gbps Quad SGMII data stream for a multiport gigabit Ethernet PHY into four separate 1.25 Gbps SGMII data
streams, containing data for each of the PHY ports, which can be independently decoded.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/qsgmii.png}
\caption{Example of decoding a QSGMII signal}
\label{filter_qsgmii}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-qsgmii.png}
\caption{Example filter graph showing usage of QSGMII filter}
\label{filter_qsgmii}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Protocol & QSGMII Input waveform\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Display Format & Enum & Specifies Dx.x or hexadecimal format for 8B/10B output\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

The output is four separate 8B/10B data streams suitable for feeding to the \hyperref[filter:sgmii]{SGMII} decode
filter

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Lane 0 & Protocol & SGMII data stream for PHY 0\\
\thinhline
Lane 1 & Protocol & SGMII data stream for PHY 1\\
\thinhline
Lane 2 & Protocol & SGMII data stream for PHY 2\\
\thinhline
Lane 3 & Protocol & SGMII data stream for PHY 3\\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\pagebreak
%\section{Ethernet - RGMII}

%Decodes the Reduced Gigabit Media Independent Interface as specified in the RGMII 2.0 specification.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet - RMII}

Decodes the Reduced Media Independent Interface as specified in the RMII specification.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet - SGMII}
\label{filter:sgmii}

Decodes Serial GMII data at 10, 100, or 1000 Mbps rates to Ethernet frames.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet Autonegotiation}
\label{filter:aneg}

Decodes the Base-T autonegotiation signaling for Ethernet as specified in IEEE 802.3-2018 clause 28.

This filter outputs a stream of 16-bit negotiation codewords, which is typically fed to the Ethernet Autonegotiation
Page filter.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/ethernet-aneg.png}
\caption{Example of decoding Ethernet autonegotiation traffic}
\label{filter_ethernet_aneg}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/ethernet-aneg-2.png}
\caption{Decoding a single 16-bit link code word}
\label{filter_ethernet_aneg_2}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-aneg.png}
\caption{Example filter graph showing usage of autonegotiation filter}
\label{filter_aneg}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Ethernet differential pair waveform\\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter outputs a stream of 16-bit link codewords.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet Autonegotiation Page}

Decodes a stream of 16-bit negotiation codewords to ability values, as specified in IEEE 802.3-2018 annex 28A, 28B, and
28C.

Note that the autonegotiation protocol is stateful, so it is not possible to definitively decode a single code word or
small group of them in isolation. For accurate decoding, the input waveform should start with the Base Page (sent
during the link-down state before a link partner has been detected).]

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/ethernet-aneg-page.png}
\caption{Example of decoding Ethernet autonegotiation traffic}
\label{filter_ethernet_aneg_page}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-aneg.png}
\caption{Example filter graph showing usage of autonegotiation page filter}
\label{filter_aneg_page}
\end{figure}
\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Protocol & Link codewords from the \hyperref[filter:aneg]{Ethernet autonegotiation} filter\\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter outputs a stream of decoded PHY ability values.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Ethernet Base-X Autonegotiation}

Decodes the Base-X autonegotiation signaling for Ethernet as specified in IEEE 802.3-2018 clause 37.

Also supports the extended autonegotiation used by SGMII.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Exponential Moving Average}
\label{filter:ema}

Calculates an exponential moving average of the input waveform, averaging the data at each sample index with the
previous values of the same over multiple consecutive acquisitions.

The average is calculated recursively; for sample value $S$ and half life $T$, the recurrence relation is:

\begin{math}
Out[i] =
	\left(1-\frac{1}{\displaystyle{2^\frac{1}{x}}}\right)\left(Out[i-1]\right) +
	\left(\frac{1}{\displaystyle{2^\frac{1}{x}}}\right)\left(S\right)
\end{math}

(This filter description is a stub and will be expanded in the future)

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input signal\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Half-life & Integer & Half life of the average, in waveforms\\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Eye Bit Rate}

Measures the bit rate of an eye pattern.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Eye Height}

Measures the vertical opening of an eye pattern.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Eye P-P Jitter}

Measures the peak-to-peak jitter of an eye pattern.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Eye Pattern}
\label{filter:eyepattern}

Calculates an eye pattern given an analog waveform and a clock (typically generated by the
\hyperref[filter:cdrpll]{Clock Recovery (PLL)} filter).

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/eye.png}
\caption{Typical usage of the eye pattern filter}
\label{filter_eye}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-eye.png}
\caption{Example filter graph for computing an eye pattern from a differential input}
\label{filter_graph_eye}
\end{figure}
\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thinhline
clk & Digital & Symbol clock \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Bit Rate & Int & Symbol rate (if not using automatic bit rate calculation)\\
\thinhline
Bit Rate Mode & Enum & Specifies whether to automatically calculate the symbol rate from the input clock,
or use a user-specified symbol rate \\
\thinhline
Center Voltage & Float & Vertical midpoint of the eye (normally 0)\\
\thinhline
Clock Edge & Float & Selects whether the sampling clock is rising edge triggered, falling edge triggered, or DDR
(default)\\
\thinhline
Mask & Filename & Path to a YAML file containing pass/fail mask polygons\\
\thinhline
Saturation Level & Float & Saturation level for normalizing eye patterns, in range [0, 1.0]. 1.0 is the default and
maps the full input range to the full output range; lower values saturate. For example 0.5 means the bottom half
of count values map to the full scale output range and anything larger is clipped to full scale. \\
\thinhline
Vertical Range & Float & Full scale Y-axis range (if not autoscaling) \\
\thinhline
Vertical Scale Mode & Enum & Specifies whether to autoscale the input or use a user-specified full scale range\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Stream name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Eye & Output eye pattern \\
\thinhline
hitrate & Scalar & Fraction of samples touching the mask (mask hits / samples integrated). If no mask is set, this
output will always be zero.\\
\thinhline
uisIntegrated & Scalar & Number of unit intervals integrated by the eye \\
\thinhline
samplesIntegrated & Scalar & Number of samples integrated by the eye \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Eye Period}

Measures the UI width of an eye pattern.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Eye Width}

Measures the horizontal opening of an eye pattern.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Fall}

Measures the fall time of each falling edge in a waveform.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{FFT}

Calculates a Fast Fourier Transform and displays the magnitude response.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{FIR}

Applies a finite-impulse-response filter to a signal.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Frequency}

Measures the frequency of each cycle in a waveform.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{FSK}

Converts a frequency-vs-time waveform (typically generated by the \hyperref[filter:vector_frequency]{Vector Frequency}
filter either directly or through a denoising filter) to a digital waveform. As of now, only BFSK is supported.

The filter calculates a histogram of the input signal each waveform, expecting a bimodal distribution. The two highest
histogram peaks are selected as the nominal logic 0 and 1 levels, with the higher frequency assigned to logic 1 and the
lower to logic 0.

Thresholding is performed at the midpoint of the nominal 0 and 1 levels, with hysteresis equal to 20\% of the
difference between the nominal levels. Using adaptive thresholds allows the filter to automatically track
frequency-hopping systems as long as only one packet is present in each waveform.

TODO: re-histogram any time we break squelch?

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Full Width at Half Maximum}
\label{filter:FullWidthHalfMaximum}

Calculates the full width at the half of maximum value of all peaks in a signal.

\begin{figure}[h]
\centering
\bigimage{images/filters/full-width-half-max.png}
\caption{Example of full width at half maximum of a Sinewave input waveform. }
\label{filter_fwhm}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Peak Threshold & Float & Pulses with peak values below this threshold are not considered\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs two analog waveforms. One shows the value of full width at half maximum value of all the peaks in the signal.
Another output waveform shows the amplitude of all the corresponding peaks.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Gate}

This filter outputs a copy of its input with zero delay if the enable signal is high. If the enable signal is low,
the output is either unchanged (latched) or no waveform is produced (gated).

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Glitch Removal}

This filter removes `glitches' from a digital waveform. A Minimum Width is specified, and any `pulse' (period during which the waveform has the same value) shorter than that pulse is ignored, the previous pulse continuing. Common use is to remove glitches from a $f$ Hz signal by filtering pulses shorter than $\frac{1}{1.1f}$ s.

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Digital & Input data. \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Minimum Width & Float & Minimum width of a pulse allowed through.\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a digital waveform which has no samples shorter than Minimum Width. The output waveform does not have any samples until the first pulse of at least Minimum Width, and the last state continues to the end of the waveform.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Group Delay}
\label{filter:groupdelay}

Calculates the group delay of a phase-vs-frequency waveform, $\frac{d\phi}{d\omega}$.

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Phase & Analog & Phase angle vs frequency\\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter outputs an analog waveform with one sample per frequency point, containing the group delay at that
frequency.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Histogram}
\label{filter:histogram}

Computes a histogram from incoming data. Histogram counts are accumulated across multiple processed waveforms and cleared
on "Clear Sweeps." Number of histogram bins is determined from the bin size parameter and the max/min values configured.
Default behavior is to autorange the input and have 100fs bins. Samples outside a configured manual range will fall into
the highest/lowest bin and the "CLIPPING" flag will be set on the output waveform.

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Analog & Input data. Usually in units of fs.\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Autorange & Bool & If the filter should automatically range the maximum and minimum bins\\
\thinhline
Min Value & Float & Lower end of the lowest bin when Autorange disabled\\
\thinhline
Max Value & Float & Higher end of the highest bin when Autorange disabled\\
\thinhline
Bin Size & Float & Size of a bin. Number of bins is determined from this and max/min values\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an analog waveform with one sample per bin and a value in counts. The "CLIPPING" flag on a waveform
indicates that input samples fell outside the configured range of bins (when not using Autoranging.)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Horizontal Bathtub}

Calculates a bathtub curve across a horizontal slice through an eye pattern.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{HDMI}
\label{filter:hdmi}

Decodes HDMI

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{$I^2C$}

Decodes the Phillips $I^2C$ bus protocol.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{$I^2C$ EEPROM}

Decodes common $I^2C$ EEPROM memory devices

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{$I^2C$ Register}

Decodes low level $I^2C$ bus traffic into a series of register read-write transactions targeting a specific device
address.

This filter assumes that the device has a fixed sized address pointer. Register writes consist of a write to the
device's address, the register address, then write data. Reads consist of a write to the device's address, the register
address, a read from the device's address, and read data.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{IBIS Driver}
\label{filter:ibisdriver}

Converts a digital waveform and double-rate clock to an analog waveform using the rising and falling edge waveforms
from an IBIS model.

This filter assumes a perfect $50\Omega$ load or other matched load as specified in the IBIS model; clamp behavior of
the driver in response to channels with significant reflection is not currently modeled.

IBIS-AMI is not currently supported, however this is planned (\issue{scopehal}{192}).

Model name and termination conditions are dynamically created enumerations; the set of legal values for these fields
depends on the specific .ibs file loaded.

Note that IBIS corners specify minimum, typical, or maximum \emph{output voltage}, not timing or other properties.

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Digital & Digital waveform to transmit\\
\thinhline
clk & Digital & Transmit clock (double rate)\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Corner & Enum & Name of the corner to use\\
\thinhline
File Path & String & Filesystem path to the IBIS model\\
\thinhline
Model Name & Enum & Name of the I/O cell model within the IBIS model to use\\
\thinhline
Sample Rate & Int & Sample rate to use for the output waveform\\
\thinhline
Termination & Enum & Name of the termination condition to use\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an analog waveform containing uniformly spaced samples at the specified rate.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Invert}
\label{filter:invert}

Inverts an analog waveform by negating each sample.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Intel eSPI}

Decodes the Enhanced Serial Peripheral Interface protocol, used between Intel CPUs and peripherals such as baseboard
management controllers (BMCs) and embedded controllers (ECs).

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{IPv4}

Internet Protocol version 4

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{IQ Demux}

Given a single waveform containing consecutively sampled I and Q values, plus a recovered clock, output separate
sampled I and Q waveforms and a half-rate clock.

I is always sampled before Q.

Two alignment methods are supported: None (first clock edge in the input is arbitrarily declared to be I)
and 100Base-T1 (the alignment with the least (0,0) symbols is preferred)

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{IQ Squelch}

Gates I/Q data to eliminate noise between packets. Signal regions with amplitude below the squelch threshold are
replaced with an equal number of zero-valued samples.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{J1939 Analog}
\label{filter:j1939analog}

Outputs an analog signal extracted from a specific J1939 PGN

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{J1939 Bitmask}
\label{filter:j1939bitmask}

Outputs a Boolean signal indicating whether a specific J1939 PGN matches a bitmask

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{J1939 PDU}
\label{filter:j1939pdu}

Decodes CAN bus IDs to decode the J1939 PDU1 and PDU2 format.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{J1939 Source Match}
\label{filter:j1939srcmatch}

Filters a sequence of J1939 PDUs to output only those which are sent from a specified source address

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{J1939 Transport}
\label{filter:j1939transport}

Decodes the J1939 transport layer (PGNs 60416 and 60160) and reassembles multi-part packets into single logical packets.
All other PGNs pass through this filter unchanged.

As of now, only broadcast mode (BAM) packets are decoded, due to lack of CM test datasets.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Jitter}
\label{filter:jitter}

Adds random and/or periodic jitter to a digital waveform by displacing each sample.

Random jitter is unbounded and has a Gaussian distribution with a user-specified standard deviation. Periodic jitter is
sinusoidal and has a bounded range of -1 to +1 times the specified amplitude. Only a single frequency of Pj is
supported, however several instances of this filter may be chained in order to inject Pj at multiple frequencies. The
starting phase of the Pj sinusoid is random.

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Digital & Input waveform\\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Rj Stdev & Float & Standard deviation of random jitter\\
\thinhline
Pj Frequency & Float & Frequency of periodic jitter\\
\thinhline
Pj Amplitude & Float & Amplitude of periodic jitter\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a digital waveform with one sample per sample in the input waveform, with sample time shifted by
the sum of random and periodic jitter terms. The output waveform will have 1fs timebase resolution and not be dense
packed, regardless of the input timebase configuration.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Jitter Spectrum}

Calculates an FFT of a TIE waveform.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{JTAG}

Joint Test Action Group

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Magnitude}

Calculates the magnitude of a complex valued signal

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Maximum}
\label{filter:maximum}

This filter calculates the maximum of its input.

\subsection{Inputs}
\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
in & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
latest & Scalar & Maximum of the filter's current input \\
\thinhline
cumulative & Scalar & Maximum of all input since the last clear-sweeps\\
\thinhline
totalSamples & Scalar & Total number of integrated samples \\
\thinhline
totalWaveforms & Scalar & Total number of integrated waveforms \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{MDIO}

Decodes the Management Data Input/Output interface on Ethernet PHYs. At the moment, only Clause 22 format is supported.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Memory}

Takes a snapshot of the input which remains ``frozen" until manually updated. Typically used for comparing past and
present values of a signal on the same plot.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{MIL-STD-1553}

Decodes the MIL-STD-1553 avionics data bus.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Minimum}
\label{filter:minimum}

This filter calculates the minimum of its input.

\subsection{Inputs}
\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
in & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
latest & Scalar & Minimum of the filter's current input \\
\thinhline
cumulative & Scalar & Minimum of all input since the last clear-sweeps\\
\thinhline
totalSamples & Scalar & Total number of integrated samples \\
\thinhline
totalWaveforms & Scalar & Total number of integrated waveforms \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{MIPI D-Phy Data}
\label{filter:dphydata}

Converts two streams of D-Phy Symbols (one data and one clock) into bytes and control events.

Only a single data lane is supported at the moment, but multi-lane support will be added in the future.

This filter only supports high speed data; escape mode data is handled by the \hyperref[filter:dphyescape]{D-PHY Escape
Mode} filter.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{MIPI D-Phy Escape Mode}
\label{filter:dphyescape}

Converts a stream of D-PHY Symbols for a data lane into low-power data.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{MIPI D-Phy Symbol}

Decodes one or two analog channels to MIPI D-PHY symbols (HS/LS line states). Either the positive half, or both
positive and negative, of the pair may be provided.

If only the positive half is provided, it is possible to decode HS data and clocks, but not the LP-01 and LP-10 states,
as these are indistinguishable from LP-00 and LP-11. This prevents proper decoding of Escape Mode data, although
Start-Of-Transmission sequences may be inferred from context.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{MIPI DSI Frame}

Converts a MIPI DSI Packet stream into video scanlines.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{MIPI DSI Packet}

Converts two streams of D-Phy Symbol's (one data and one clock) into MIPI DSI packets.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Moving Average}

Calculates a moving average (box filter) over an analog waveform.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Multiply}

Multiplies one waveform or scalar by another. No resampling is performed; if both inputs are waveforms they must
have identical sample rates and be aligned in time.

Unit conversions are performed, for example the product of a voltage and current waveform is a power waveform.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{NCO}

Numerically controlled oscillator: creates a sinusoidal waveform whose frequency tracks a target value

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Noise}

Adds Gaussian noise with a specified standard deviation to a waveform.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Overshoot}

Measures overshoot of a signal's rising edges past the top value

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{PAM4 Demodulator}

Converts an analog PAM4 waveform and recovered clock into a digital serial waveform and recovered clock at twice the
symbol rate. This allows conventional NRZ protocol decodes to be applied to a PAM4 data stream.

Gray coding is assumed, as used by all major PAM-4 networking standards.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{PAM Edge Detector}
\label{filter:pamedge}

Finds level crossings in a PAM signal (of arbitrary order) and outputs a digital waveform which toggles each time the
PAM signal transitions to a new level. This may be used as the input to a CDR PLL block which is designed to work on
NRZ input.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\pagebreak
%\section{Parallel Bus}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{PcapNG Export}

Exports a series of packets to a PCAPNG file (or pipe). As of this writing, Ethernet is the only implemented link layer.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{PcapNG Import}

Imports a PcapNG file as a list of packets. As of this writing, CAN is the only implemented link layer.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{PCIe Data Link}

Decodes the Data Link layer of PCI Express. At this layer DLLPs are fully decoded. TLP sequence numbers are visible
and CRC16s are checked, however TLP content is displayed as hex dumps.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{PCIe Gen 1/2 Logical}
\label{filter:pcie2_logical}

Decodes the Logical Sub-Block of the PCI Express 1.0 and 2.0 PHY. This layer decodes 8B/10B symbols and the LFSR
scrambler. TLP and DLLP start/end markers are identified but no packet decoding is performed.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{PCIe Gen 3/4/5 Logical}

Decodes the Logical Sub-Block of the PCI Express 3.0, 4.0, and 5.0 PHY. This layer converts 128b/130b symbols into a
stream of protocol packets and content. TLP and DLLP start/end markers are identified but no packet decoding is
performed.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{PCIe Link Training}

Decodes the initial PCIe gen1/2 link training sequence. Training to gen3 and higher speeds is not yet implemented.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{PCIe Transport}

Decodes the Transaction layer of PCI Express. At this layer TLPs are fully decoded, however only a unidirectional view
of the system is visible (only TX or only RX).

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Peak Hold}

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Peak-to-Peak}

Measures the peak-to-peak amplitude of a signal

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Peaks}

Finds peaks in a waveform (typically a spectrum of some sort)

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Period}

Measures the period of a waveform

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Phase}

Displays the relative phase of a signal as a function of time. Typically used for visualizing PSK modulations.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Phase Nonlinearity}

Given a phase angle waveform, outputs the difference between the actual phase and linear phase. A perfectly linear
network will be displayed as a horizontal line at Y=0; leading or lagging phase will show up as spikes above or below
zero.

The nominal linear phase response is calculated based on the averge group delay between two user-supplied frequencies.
Moving the reference frequencies further apart reduces the impact of phase noise in the data (since more points are
being averaged) however both points must be located well within the linear region of the network in order to give
accurate results.

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/phase-nonlinearity.png}
\caption{Example of nonlinear phase of a dispersive transmission line}
\label{phase_nonlinearity_example}
\end{figure}

\begin{figure}[h]
\centering
\bigimage{ng-images/filters/graph-phase-nonlinearity.png}
\caption{Example filter graph for measuring nonlinearity}
\label{phase_nonlinearity_graph}
\end{figure}

\FloatBarrier

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Phase & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Ref Freq Low & Float & Lower reference frequency\\
\thinhline
Ref Freq High & Float & Upper reference frequency\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an analog waveform with one sample for each sample in the input, containing the deviation from
linear phase.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Point Sample}
\label{filter:pointsample}

This filter samples the value of a waveform at a given X coordinate and outputs the sampled value as a scalar.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{PRBS}

Generates a pseudorandom bit sequence, and double rate bit clock, with a specified bit rate from a list of standard
polynomials.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Pulse Width}
\label{filter:pulsewidth}

This filter measures the length and amplitude of pulses and outputs that as a waveform. It auto-thresholds analog inputs at 50\%.

\begin{figure}[h]
\centering
\bigimage{images/filters/pulse-width.png}
\caption{Example of pulse width measurement of a clipped sinewave input waveform.}
\label{filter_pulsewidth}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs two output waveforms. One is a sparse analog waveform with the same timebase as the input, containing one sample per pulse with
a duration and value equal to the length of the pulse. Other is a similar sparse analog waveform, but its values are equal to the amplitude of the pulses. In case,
the input is uniform or sparse digital, this second output waveform is uniform or sparse digital respectively instead of analog.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{QSPI}

Quad SPI as used in serial Flash. Note that this filter \emph{only} decodes quad mode streams, not x1 SPI.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Quadrature}

Quadrature pulses from a rotary encoder

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Reference Plane Extension}

Given a set of S-parameters, shifts the reference plane on one or two ports and outputs a new set of S-parameters.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{RGB LED}
\label{filter:rgbled}

Decodes the single-wire serial protocol used by common addressable RGB LEDs such as the WS2812

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{RIS}

Performs random interleaved sampling (RIS) on a repetitive, uniformly sampled analog waveform in order to create a
waveform with a higher effective sample rate.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Rise}

Calculates the rise time for each cycle of a waveform

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Rj + BUj}

Removes data-dependent jitter (DDJ) from a TIE waveform, leaving uncorrelated jitter (Rj and BUj).

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{RMS}
\label{filter:rms}

Measures the Root Mean Square value of the waveform, including any DC component

%\begin{figure}[h]
%\centering
%\bigimage{images/filters/ac-rms.png}
%\caption{Example of an AC RMS Measurement of a Sinewave with 1V peak voltage}
%\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter has two output streams.

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Stream name} & \textbf{Type} & \textbf{Description} \\
\thickhline
trend & Sparse analog & One sample per cycle of the input waveform containing the RMS value across that cycle \\
\thinhline
avg & Scalar & RMS value across the entire waveform \\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{S-Parameter Cascade}
\label{filter:sparamcascade}

Cascades two two-port networks and outputs a two-port network equivalent to the two input networks in series.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Sawtooth}

Generates a sawtooth waveform.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{S-Parameter De-Embed}

Given a two port network equal to the cascade of two others, plus S-parameters for one of the two sub-networks, output
S-parameters for the other.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Scalar Pulse Delay}

Delays a scalar pulse by approximately the specified real time.

This filter is intended for use in control or test applications to trigger a measurement after an experimental setup has
had time to stabilize.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Scalar Stairstep}

Outputs a scalar value which ramps from a starting value to an ending value in a stairstep pattern, with configurable
step duration and spacing.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{SD Card Command}


(This filter description is a stub and will be expanded in the future)
Decodes the Secure Digital card command bus protocol

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Setup / Hold}

Calculates the setup and hold times of a data signal relative to a clock.

Setup time is measured from data valid (leaving the undefined region between Vil and Vih) to clock invalid (entering
the undefined region). Hold time is measured from clock valid to data invalid.

The overall setup and hold times reported by the filter are the minimums observed across the entire waveform.

If the undefined regions of data and clock signals ever overlap, both setup and hold time are reported as zero.

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
data & Analog & Input data \\
\thinhline
clock & Analog & Input clock \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Vih & Float & High level threshold for the input buffer\\
\thinhline
Vil & Float & Low level threshold for the input buffer\\
\thinhline
Clock Edge & Enum &
	\textbf{Rising}: Sample data on the rising clock edge \newline
	\textbf{Falling}: Sample data on the falling clock edge \newline
	\textbf{Both}: Sample data on both clock edges\\
\thickhline
\end{tabularx}

\subsection{Output Signal}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
tsetup & Analog scalar & Lowest setup time observed in the waveform\\
\thinhline
thold & Analog scalar & Lowest hold time observed in the waveform\\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Sine}

Generates a pure sine wave with specified frequency, amplitude, sample rate, and DC bias.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{SNR}
Computes simple $\frac{\mu}{\sigma}$ (mean over standard deviation) signal-to-noise ratio for the input signal.

(This filter description is a stub and will be expanded in the future)

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
in & Analog & Input Waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter outputs a scalar value representing the $\frac{\mu}{\sigma}$ SNR for the whole waveform. For sparse
waveforms samples are weighted by length and gaps are not considered.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Spectrogram}

Displays a 2D plot of frequency vs time using configurable FFT length.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{SPI}

Serial Peripheral Interface.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{SPI Flash}

Flash memory attached to a SPI or quad SPI bus. Typically these chips have part numbers that start with ``25".

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Squelch}

Detects periods with no signal.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Step}

Generates a single step from one voltage level to another. Typically used for measuring step response of a channel or
doing TDR transforms on S-parameters.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Subtract}

Subtracts one waveform from another. No resampling is performed; both inputs must have identical sample rates.

(This filter description is a stub and will be expanded in the future)

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
IN+ & Analog & Positive input waveform \\
\thinhline
IN- & Analog & Negative input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter outputs an analog waveform with one sample for each sample in the input, containing the difference of the
two input waveforms.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{SWD}

The Serial Wire Debug protocol between a Debug Probe and an ARM Microcontroller, typically from the CORTEX-M family. This
decode recognises all SWD frame elements and validates type and parity of both incoming and outgoing messages. It also
identifies line resets and line protocol change messages.

The SWD Protocol defines that the target will read and write on the rising edge of SWCLK. It does not place any constraint
on when the probe reads and writes. For the purposes of graphical depiction each protocol element starts at a falling edge
and continues to be valid until the next falling edge, following the graphical convention established in the ARM documentation.

Reference: ARM Debug Interface v5 Architecture Specification, Chapter 4.

\begin{figure}[h]
\centering
\bigimage{images/filters/swd.png}
\caption{Example of SWD protocol decode}
\label{swd_example}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
SWDIO & Digital & Serial Wire Data In/Out (To/From target)\\
SWCLK & Digital & Serial Wire Clock In (To Target from Debug Probe)\\
\thickhline
\end{tabularx}

\subsection{Parameters}

No parameters are required for configuration of SWD. The protocol is clocked by SWCLK.

\subsection{Output Signal}

The SWD bus decode outputs a time series of SWD message elements, each of which may be one or a number of bits long.
Each message element consist of a type and optional numeric content.

\begin{tabularx}{16cm}{lllX}
\thickhline
\textbf{Type} & \textbf{Description} & \textbf{Color} & \textbf{Format} \\
\thickhline
Line Control & Line Reset & \cellcolor{preamble}\textcolor{white}{Preamble} & LINE RESET \\
\thinhline
Line Mode & Line Mode Change to SWD & \cellcolor{control}\textcolor{white}{Control} & JTAG TO SWD \\
\thinhline
Line Mode & Line Mode Change to JTAG & \cellcolor{control}\textcolor{white}{Control} & SWD TO JTAG \\
\thinhline
Line Mode & Line Mode Change to Dormant & \cellcolor{control}\textcolor{white}{Control} & SWD TO DORMANT \\
\thinhline
Line Mode & Leave Dormant Mode & \cellcolor{control}\textcolor{white}{Control} & LEAVE DORMANT \\
\thinhline
Start & Start of frame & \cellcolor{preamble}\textcolor{white}{Preamble} & START \\
\thinhline
APnDP & Selection between AP and DP & \cellcolor{control}\textcolor{white}{Control} & AP|DP  \\
\thinhline
RnW & Read or Write mode & \cellcolor{control}\textcolor{white}{Control} & R|W  \\
\thinhline
ADDR & AP or DP Address & \cellcolor{address}\textcolor{black}{Address} & Reg \%02x \\
\thinhline
Parity & Good Header Parity & \cellcolor{green}\textcolor{black}{Control} & OK  \\
\thinhline
Parity & Bad Header Parity & \cellcolor{red}\textcolor{white}{Control} & BAD  \\
\thinhline
Stop & End of Header & \cellcolor{preamble}\textcolor{white}{Preamble} & STOP \\
\thinhline
Park & Line Release & \cellcolor{preamble}\textcolor{white}{Preamble} & PARK \\
\thinhline
Turnaround & Line Direction Change & \cellcolor{preamble}\textcolor{white}{Preamble} & TURN \\
\thinhline
Acknowledge & Good Response from target to request & \cellcolor{control}\textcolor{white}{Control} & ACK|WAIT    \\
\thinhline
Acknowledge & Bad Response from target to request & \cellcolor{control}\textcolor{white}{Control} & FAULT|ERROR    \\
\thinhline
Data & Payload to/From Target & \cellcolor{data}\textcolor{white}{Data} & \%08x \\
\thinhline

\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{SWD MEM-AP}

Converts SWD accesses to MEM-AP registers into memory read-write transactions.

Reference: ARM Debug Interface v5 Architecture Specification, chapter 8.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Tachometer}

Converts pulses from a tachometer to shaft speed

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Tapped Delay Line}

Generic FIR filter with arbitrary tap values and delays. Can be used as-is for testing FIR filter coefficients
calculated by hand, but most commonly used as a base class for more specialized filters.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{TCP}

Decodes the Transmission Control Protocol (RFC 675). As of this writing, only IPv4 is supported as a network layer
protocol. IPv6 support is planned once an IPv6 protocol decode has been written.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{TDR}

Converts a TDR waveform from volts to reflection coefficient or impedance.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Time Outside Level}

Measures the total integrated time a signal remains above a high reference level or below a low reference level or both.

\begin{figure}[h]
	\centering
	\bigimage{images/filters/time-outside-level.png}
	\caption{Example of time outside high level measurement with a high level threshold of 0mV}
	\label{filter_timeoutsidelevel}
	\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
High Level & Float & High level reference voltage\\
\thinhline
Low Level & Float & Low level reference voltage\\
\thinhline
Measurement Type & Enum &
	\textbf{High Level}: Measure the total time the signal is above high level reference voltage \newline
	\textbf{Low Level}: Measure the total time the signal is below low level reference voltage \newline
	\textbf{Both}: Measure the total time the signal is both above and below high level and low level reference voltages respectively\\
\thickhline
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Thermal Diode}

Converts an analog voltage measurement of a thermal diode to a temperature value

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Threshold}

Converts an analog waveform to digital by thresholding at a constant level (no hysteresis).

(This filter description is a stub and will be expanded in the future)

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Threshold & Float & Decision threshold \\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs an digital waveform with one sample for each sample in the input, which is true if the
corresponding input sample is above the threshold and false if less than or equal.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{TIE}

Calculates the time interval error of a data or clock signal with respect to an ideal ``golden" clock (typically
obtained from a CDR PLL).

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Top}

Calculates the top (logical one level) of each cycle in a digital waveform. It is most commonly used as an input to
statistics, to view the average top of the entire waveform.

(This filter description is a stub and will be expanded in the future)

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter outputs an analog waveform with one sample for each group of logical ones in the input signal, containing
the average value of the one level.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Touchstone Export}

Saves S-parameter data to a Touchstone file.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Touchstone Import}

Loads a Touchstone file and displays the complex data in magnitude/angle format

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Trend}

Plots a trend of a scalar value over time

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{TRC Import}

Loads waveform data from a Teledyne LeCroy TRC waveform file.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{UART}

Decode serial ports

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Unwrapped Phase}

Given a phase angle waveform which wraps within the interval $[-180\degree, +180 \degree]$, unwrap the phase angle.

\begin{figure}[h]
\centering
\bigimage{images/filters/unwrapped-phase.png}
\caption{Example of wrapped and unwrapped phase of a transmission line}
\label{unwrapped_phase_example}
\end{figure}

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Phase & Analog & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

This filter takes no parameters.

\subsection{Output Signal}

This filter outputs an analog waveform with one sample for each sample in the input, containing the unwrapped phase
angle.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{USB 1.0 / 2.x Activity}

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{USB 1.0 / 2.x Packet}

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{USB 1.0 / 2.x PCS}

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{USB 1.0 / 2.x PMA}

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Undershoot}

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Upsample}

Upsamples a waveform using sin(x)/x interpolation.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{VCD Import}

Loads digital waveform data from a Value Change Dump (VCD) file.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Vector Frequency}
\label{filter:vector_frequency}

Calculates the instantaneous frequency (rotational velocity) of a complex I/Q signal.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Vector Phase}

Calculates the instantaneous phase of a complex I/Q signal.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Vertical Bathtub}

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{VICP}

Decodes the Teledyne LeCroy Virtual Instrument Control Protocol (VICP)

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Waterfall}

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{WAV Import}

Loads waveform data from a Microsoft WAV audio file.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{WFM Import}

Loads waveform data from a Tektronix .wfm file.

(This filter description is a stub and will be expanded in the future)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Windowed Autocorrelation}

Calculates the cross-correlation between a fixed size block of the input signal and another block of the same size.

This will produce maximal response for a signal which has periodicity with the specified period and block size.

For example, period 4 and block size 2 will match aa**aa**.

This can be used to identify OFDM symbols.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{Window}

Selects a temporal subset of an input waveform. Useful for running intensive analyses only on a region of interest.
Start and end times are rounded to the sample that starts at or nearest after the given time.

(This filter description is a stub and will be expanded in the future)

\subsection{Inputs}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Signal name} & \textbf{Type} & \textbf{Description} \\
\thickhline
din & Analog or Digital & Input waveform \\
\thickhline
\end{tabularx}

\subsection{Parameters}

\begin{tabularx}{16cm}{llX}
\thickhline
\textbf{Parameter name} & \textbf{Type} & \textbf{Description} \\
\thickhline
Start Time & Float & Start of selected window \\
\thinhline
Duration & Float & Length of selected window \\
\thickhline
\end{tabularx}

\subsection{Output Signal}

This filter outputs a subset of the input signal. If the input is sparse, so is the output and vice versa. No samples
are added.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\section{X-Y Sweep}

This filter converts a sweeping X scalar value and a corresponding Y scalar value into a waveform plotting X against Y.

Note that this filter assumes that the X value is sweeping in an upwards ramp, and is not intended for use with
arbitrary X-Y data. In particular, the output is a standard sparse waveform type rather than an X-Y density map.

(This filter description is a stub and will be expanded in the future)
